<?php /* Smarty version 2.6.20, created on 2017-05-20 21:11:08
         compiled from spot_opt.htm */ ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>添加场馆</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<link href="admin.css" rel="stylesheet" type="text/css" />
<script src="<?php echo $this->_tpl_vars['config']['weburl']; ?>
/script/jquery-1.4.4.min.js" type="text/javascript" charset="utf-8" ></script>
<script src="<?php echo $this->_tpl_vars['config']['weburl']; ?>
/script/my_lightbox.js" type="text/javascript" charset="utf-8"></script>
<script src="<?php echo $this->_tpl_vars['config']['weburl']; ?>
/script/district.js" type="text/javascript" charset="utf-8"></script>
<script language="javascript">
var weburl="<?php echo $this->_tpl_vars['config']['weburl']; ?>
";
</script>
</head>
<body>
<div class="container">
<div class="flow">
    <div class="itemtitle">
        <h3>添加场馆</h3>

    </div>
</div>
<div class="h35"></div>
<form method="post" action="" enctype="multipart/form-data">
    <table class="table" id="base">
    <thead>
    <tr>
        <th colspan="2" class="partition">基本信息</th>
    </tr>
    </thead>
    
    <tbody>
    <tr>
        <td>所属分类</td>
        <td>
            <select name="cat_id" id="cat_id" class="w350">
                <option value="">请选择</option>
                <?php $_from = $this->_tpl_vars['cat_list']; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array'); }if (count($_from)):
    foreach ($_from as $this->_tpl_vars['vo']):
?>
                <option value="<?php echo $this->_tpl_vars['vo']['id']; ?>
" <?php if ($this->_tpl_vars['de']['cat_id'] == $this->_tpl_vars['vo']['id']): ?>selected<?php endif; ?> ><?php echo $this->_tpl_vars['vo']['cat_name']; ?>
</option>
                <?php endforeach; endif; unset($_from); ?>
            </select>
        </td>
    </tr>

    <tr>
        <td>场次ID</td>
        <td><input maxlength="100" name="pid" type="text" id="pid" class="w350" value="<?php echo $this->_tpl_vars['de']['pid']; ?>
" /></td>
    </tr>

    <tr>
      <td>场馆名称</td>
      <td><input maxlength="100" name="spot_name" type="text" id="spot_name" class="w350" value="<?php echo $this->_tpl_vars['de']['spot_name']; ?>
" /></td>
    </tr>

    <tr>
        <td>场馆电话</td>
        <td><input maxlength="100" name="tel" type="text" id="tel" class="w350" value="<?php echo $this->_tpl_vars['de']['tel']; ?>
" /></td>
    </tr>

    <tr>
        <td>场馆地址</td>
        <td><input maxlength="100" name="address" type="text" id="address" class="w350" value="<?php echo $this->_tpl_vars['de']['address']; ?>
" /></td>
    </tr>
    
    <tr>
        <td>上传图片</td>
        <td>
            <div class="product_image">
                <ul id="list1">
                    <li id="p1" data-itemid="1">
                        <div data_type="handle_image" style="cursor: pointer;">
                            <div class="image" style="cursor: pointer;">
                                <input name="picurl" type="hidden" id="pic0" value="<?php echo $this->_tpl_vars['de']['picurl']; ?>
">
                                <?php if (empty ( $this->_tpl_vars['de']['picurl'] )): ?>
                                <img width="60" id="pic0_img" src="<?php echo $this->_tpl_vars['config']['weburl']; ?>
/image/default/nopicsmall.gif">
                                <?php else: ?>
                                <img width="60" id="pic0_img" src="<?php echo $this->_tpl_vars['de']['picurl']; ?>
">
                                <?php endif; ?>
                            </div>
                            <div data_type="handle" class="bg" style="cursor: pointer;">
                                <span title="删除" data_type="delete_image" class="delete">删除</span>
                            </div>
                        </div>
                        <div class="upload-btn" style="cursor: pointer;"><a class="upload-button" href="javascript:uploadfile('Style images','pic0',480,320,'spot')">上传</a></div>
                    </li>

                </ul>
            </div>
        </td>
    </tr>

    <tr>
        <td>上传场馆座位图电脑端</td>
        <td>
            <div class="product_image">
                <ul >
                    <li id="p2" data-itemid="1">
                        <div data_type="handle_image" style="cursor: pointer;">
                            <div class="image" style="cursor: pointer;">
                                <input name="seat_pic" type="hidden" id="pic1" value="<?php echo $this->_tpl_vars['de']['seat_pic']; ?>
">
                                <?php if (empty ( $this->_tpl_vars['de']['seat_pic'] )): ?>
                                <img width="60" id="pic1_img" src="<?php echo $this->_tpl_vars['config']['weburl']; ?>
/image/default/nopicsmall.gif">
                                <?php else: ?>
                                <img width="60" id="pic1_img" src="<?php echo $this->_tpl_vars['de']['seat_pic']; ?>
">
                                <?php endif; ?>
                            </div>
                            <div data_type="handle" class="bg" style="cursor: pointer;">
                                <span title="删除" data_type="delete_image" class="delete">删除</span>
                            </div>
                        </div>
                        <div class="upload-btn" style="cursor: pointer;"><a class="upload-button" href="javascript:uploadfile('Style images','pic1',740,293,'spot')">上传</a></div>
                    </li>

                </ul>
            </div>
        </td>
    </tr>



  <tr>
        <td>上传场馆座位图手机端</td>
        <td>
            <div class="product_image">
                <ul >
                    <li id="p2" data-itemid="1">
                        <div data_type="handle_image" style="cursor: pointer;">
                            <div class="image" style="cursor: pointer;">
                                <input name="seat_m_pic" type="hidden" id="pic2" value="<?php echo $this->_tpl_vars['de']['seat_m_pic']; ?>
">
                                <?php if (empty ( $this->_tpl_vars['de']['seat_m_pic'] )): ?>
                                <img width="60" id="pic2_img" src="<?php echo $this->_tpl_vars['config']['weburl']; ?>
/image/default/nopicsmall.gif">
                                <?php else: ?>
                                <img width="60" id="pic2_img" src="<?php echo $this->_tpl_vars['de']['seat_m_pic']; ?>
">
                                <?php endif; ?>
                            </div>
                            <div data_type="handle" class="bg" style="cursor: pointer;">
                                <span title="删除" data_type="delete_image" class="delete">删除</span>
                            </div>
                        </div>
                        <div class="upload-btn" style="cursor: pointer;"><a class="upload-button" href="javascript:uploadfile('Style images','pic2',235,235,'spot')">上传</a></div>
                    </li>

                </ul>
            </div>
        </td>
    </tr>



    <tr>
        <td>是否显示</td>
        <td>
            <input type="checkbox" value="1" id="statu" name="statu"  <?php if ($this->_tpl_vars['de']['statu']): ?> checked="checked" <?php endif; ?> >是
        </td>
    </tr>

    </tbody>
    </table>
    

    
    <table class="table">
    <thead>
    <tr>
        <th colspan="2" class="partition">详细介绍</th>
    </tr>
    </thead>
    
    <tbody>
    <tr>
        <td colspan="2" class="detail">
        <script charset="utf-8" src="<?php echo $this->_tpl_vars['config']['weburl']; ?>
/lib/kindeditor/kindeditor-min.js"></script>
        <script>
            var editor;
            KindEditor.ready(function(K) {
                editor = K.create('textarea[name="content"]', {});
        });
        </script>
        <textarea name="content" id="content" style="width:100%; height:400px;"><?php echo $this->_tpl_vars['de']['content']; ?>
</textarea>
        </td>
    </tr>

    </tbody>
    </table>
    <table>
    <tr>
        <td colspan="2" style="border-top:1px dotted #DEEFFB;">
            <input type="submit" name="submit" value="<?php echo $this->_tpl_vars['lang']['submit']; ?>
" class="submit" onClick="return check_value();"/>
            <input name="act" type="hidden" value="<?php if ($this->_tpl_vars['act'] == 'add'): ?>add<?php elseif ($this->_tpl_vars['act'] == 'edit'): ?>edit<?php endif; ?>" />
            <input name="editid" type="hidden" id="editid" value="<?php echo $this->_tpl_vars['de']['id']; ?>
" />

        </td>
    </tr>
    </table>
</form>
</div>
</body>
</html>
<script language="javascript" src="<?php echo $this->_tpl_vars['config']['weburl']; ?>
/script/product.js"></script>
<script language="javascript" src="<?php echo $this->_tpl_vars['config']['weburl']; ?>
/script/jquery.dragsort-0.5.1.min.js"></script>
<script type="text/javascript">


$("#list1").dragsort({ dragSelector: "div", dragSelectorExclude:"span",dragBetween: true, dragEnd: saveOrder, placeHolderTemplate: "<li class='placeHolder'><div></div></li>" });

function saveOrder()
{
	var data = $("#list1 li").map(function() { return $(this).data("itemid"); }).get();
};

function check_value()
{
    if($('#cat_id').val()=='')
    {
        alert('请选择分类');
        return false;
    }
    if($('#pid').val()=='')
    {
        alert('请输入场次ID');
        return false;
    }
    if($('#spot_name').val()=='')
    {
        alert('请输入场馆名称');
        return false;
    }
	if(!$('#img0').val())
	{
		if($('#pic0').val()=='')
		{
			alert('请上传图片');
			document.getElementById('pic0').focus();
			return false;
		}
	}
    if($('#address').val()=='')
    {
        alert('请输入场馆地址');
        return false;
    }

    return true;

}


</script>